package com.easy.query.test.doc.entity.proxy;

import com.easy.query.core.expression.parser.core.available.TableAvailable;
import com.easy.query.core.proxy.AbstractProxyEntity;
import com.easy.query.core.proxy.SQLColumn;
import com.easy.query.core.proxy.SQLSelectAsExpression;
import com.easy.query.core.proxy.fetcher.AbstractFetcher;
import com.easy.query.core.proxy.core.EntitySQLContext;
import com.easy.query.test.doc.entity.SysUser;
import com.easy.query.core.proxy.columns.types.SQLStringTypeColumn;
import com.easy.query.core.proxy.columns.types.SQLLocalDateTimeTypeColumn;

/**
 * this file automatically generated by easy-query, don't modify it
 * 当前文件是easy-query自动生成的请不要随意修改
 * 如果出现属性冲突请使用@ProxyProperty进行重命名
 *
 * @author easy-query
 */
public class SysUserProxy extends AbstractProxyEntity<SysUserProxy, SysUser> {

    private static final Class<SysUser> entityClass = SysUser.class;

    public static final SysUserProxy TABLE = createTable().createEmpty();

    public static SysUserProxy createTable() {
        return new SysUserProxy();
    }

    public SysUserProxy() {
    }

    /**
     * {@link SysUser#getId}
     */
    public SQLStringTypeColumn<SysUserProxy> id() {
        return getStringTypeColumn("id");
    }

    /**
     * {@link SysUser#getName}
     */
    public SQLStringTypeColumn<SysUserProxy> name() {
        return getStringTypeColumn("name");
    }

    /**
     * {@link SysUser#getAccount}
     */
    public SQLStringTypeColumn<SysUserProxy> account() {
        return getStringTypeColumn("account");
    }

    /**
     * {@link SysUser#getDepartName}
     */
    public SQLStringTypeColumn<SysUserProxy> departName() {
        return getStringTypeColumn("departName");
    }

    /**
     * {@link SysUser#getPhone}
     */
    public SQLStringTypeColumn<SysUserProxy> phone() {
        return getStringTypeColumn("phone");
    }

    /**
     * {@link SysUser#getCreateTime}
     */
    public SQLLocalDateTimeTypeColumn<SysUserProxy> createTime() {
        return getLocalDateTimeTypeColumn("createTime");
    }


    @Override
    public Class<SysUser> getEntityClass() {
        return entityClass;
    }

    @Override
    public SysUserProxy createNew() {
        return createTable();
    }


    /**
     * 数据库列的简单获取
     *
     * @return
     */
    public SysUserProxyFetcher FETCHER = new SysUserProxyFetcher(this, null, SQLSelectAsExpression.empty);


    public static class SysUserProxyFetcher extends AbstractFetcher<SysUserProxy, SysUser, SysUserProxyFetcher> {

        public SysUserProxyFetcher(SysUserProxy proxy, SysUserProxyFetcher prev, SQLSelectAsExpression sqlSelectAsExpression) {
            super(proxy, prev, sqlSelectAsExpression);
        }


        /**
         * {@link SysUser#getId}
         */
        public SysUserProxyFetcher id() {
            return add(getProxy().id());
        }

        /**
         * {@link SysUser#getName}
         */
        public SysUserProxyFetcher name() {
            return add(getProxy().name());
        }

        /**
         * {@link SysUser#getAccount}
         */
        public SysUserProxyFetcher account() {
            return add(getProxy().account());
        }

        /**
         * {@link SysUser#getDepartName}
         */
        public SysUserProxyFetcher departName() {
            return add(getProxy().departName());
        }

        /**
         * {@link SysUser#getPhone}
         */
        public SysUserProxyFetcher phone() {
            return add(getProxy().phone());
        }

        /**
         * {@link SysUser#getCreateTime}
         */
        public SysUserProxyFetcher createTime() {
            return add(getProxy().createTime());
        }


        @Override
        protected SysUserProxyFetcher createFetcher(SysUserProxy cp, AbstractFetcher<SysUserProxy, SysUser, SysUserProxyFetcher> prev, SQLSelectAsExpression sqlSelectExpression) {
            return new SysUserProxyFetcher(cp, this, sqlSelectExpression);
        }
    }


    public static final class Fields {
        public static final String id = "id";
        public static final String name = "name";
        public static final String account = "account";
        public static final String departName = "departName";
        public static final String phone = "phone";
        public static final String createTime = "createTime";

        private Fields() {
        }
    }
}
